package psi.controllers;

import com.jfinal.aop.Before;
import com.jfinal.ext.interceptor.POST;
import com.jfinal.plugin.activerecord.Record;

import psi.services.BizlogService;
import psi.services.UpdateDBService;

public class BizlogController extends PSIBaseController {
	public void index() {
		initVarsForView();

		setAttr("title", "首页");

		render("index.html");
	}

	@Before(POST.class)
	public void logList() {
		Record params = new Record();
		params.set("start", getPara("start"));
		params.set("limit", getPara("limit"));

		renderJson(new BizlogService().logList(params));
	}

	@Before(POST.class)
	public void updateDatabase() {
		renderJson(new UpdateDBService().updateDatabase());
	}
}
